|
|
|
| Table 1.1 ScaleMode Property Values | | SCALE MODE | MEANING | | vbTwips | There are 1440 twips per logical inch (20 twips per point). | | vbPoints | There are 72 printer's points per logical inch. | | vbPixels | The pixel is the smallest unit of display on your screen (a single dot). | | vbCharacters | Characters measure 12 points (240 twips) per unit vertically and 6 points (120 twips) per unit horizontally. | | vblnches | Measurements in logical inchs. | | vbMillimeters | There are roughly 254 millimeters per logical inch. | | vbCentimeters | There are roughly 2.54 centimeters per logical inch. |
|
|
|
|
|
|
the first character would be at position (0, 0), the next at (1, 0), and so forth. In practice, this may not be terribly useful because many programs use proportional fonts. Different characters have different widths, so they do not line up nicely in rows and columns. |
|
|
|
|
|
|
|
|
Another value for the ScaleMode property is vbUser. This value indicates a custom coordinate system defined by the application. Generally, a program does not set ScaleMode to this value. Visual Basic sets ScaleMode to vbUser when the program installs a custom coordinate system as described in the following section. |
|
|
|
|
|
|
|
|
One last standard coordinate system worth mentioning here is vbHimetric. There are 100 himetric units per millimeter. The value vbHimetric is not included in Table 1.1 because you cannot select it as a ScaleMode value. Some functions return lengths in himetric units, however, so it is worth knowing what they are. You can use the ScaleX and ScaleY methods described shortly to convert from these units into something more useful. |
|
|
|
|
|
|
|
|
In addition to the standard coordinate systems listed in the previous section, a program can define its own coordinate system. A drawing object's ScaleLeft and ScaleTop properties define the coordinates of the leftmost and topmost points in the drawing area. The ScaleWidth and ScaleHeight properties determine how wide and how tall the drawing object is in custom units. For example, if you set ScaleWidth to 100, the X coordinates of the points in the drawing area will range from ScaleLeft to ScaleLeft + 100. |
|
|
|
|
|
|
|
|
Suppose you want to draw a bar chart like the one shown in Figure 1.2. This chart represents seven data items with values between 50 and 100. You could use these custom coordinates to simplify the drawing of the chart: |
|
|
|
 |
|
|
|
|
ScaleLeft: 0
ScaleWidth: 9
ScaleTop: 110
ScaleHeight: 120 |
|
|
|
|
|